﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.Core.DomainModel;
using MethodWorx.Core.Serialization;

namespace MethodWorx.CMS.Plugins
{
    [Serializable]
    public class PluginUserData : AggregateRoot, ISerializationTypeDiscovery
    {
        public Guid PluginId { get; set; }
        public Guid? EntityId { get; set; }
        public string UserDataType { get; set; }
        public object UserData { get; set; }
        public bool Deleted { get; set; }

        public IEnumerable<Type> GetTypesForSerializer()
        {
            yield return this.GetType();
            if (this.UserData != null)
                yield return this.UserData.GetType();
        }
    }
}
